|
![](/i/fill.gif) |
> I remember from my Numerical Analysis courses, that some authors recommend
> the optimal size for the epsilon as sqrt(EPS) where EPS is the distance from
> 1.0 to the next largest floating point number. In a traditional PC, I
> believe EPS is approx 2.2e-16, so the optimal epsilon is approximately
> 1.4e-8
Note that we are not using an epsilon value for making comparisons, but
for making vector math which should be as accurate as possible.
The smaller the epsilon value we use for approximating the tangent of the
spline, the more error-prone it will become (due to inaccuracies with very
small values).
When we compare values a really small value is enough (as long as it's
bigger than 0) because we only need to see if two numbers are equal or not.
However in this case we are performing calculations which should not suffer
from inaccuracies.
On the other hand, using an epsilon value which is too big can result in
inaccurate results (because the result deviates too much from the real
tangent).
Thus a proper compromise has to be found.
In the case of splines, which are usually really smooth, we don't really
need a very small epsilon value. Even with rather big values (eg. 1e-3 or
something similar) we still get really acceptable results.
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
![](/i/fill.gif) |